package com.mtao.mapper;

import com.mtao.entity.Banner;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BannerMapper {

    @Insert("insert into banner (user_id,url,type,sort,img) values (#{userId},#{url},#{type},#{sort},#{img})")
    void addBanner(Banner banner);


    List<Banner> list(String type);


    @Delete("delete from banner where id=#{id};")
    void delete(int anInt);


    @Select("select * from banner where type=#{type}")
    List<Banner> bannerAllList(String type);
}
